//
// Copyright (c) 1995 Molecular Structure Corporation
//
// RESTRICTED RIGHTS NOTICE SHORT FORM (JUNE 1987)
//
// Use, reproduction, or disclosure is subject to restrictions set
// forth in Contract No. W-31-109-ENG-38 and Contract No. 
// 943072401 with the University of Chicago, Operator of
// Argonne National Laboratory.
//
// CUIom8.cc   Initial author: J.W. Pflugrath           16-Dec-1995
//    This file contains the methods to implement the user interface class
//    CUIom8 which implements an option menu with 8 possible choices
/*
 *
 * Copyright (C) 2014 Rigaku Americas Corporation
 *                    9009 New Trails Drive
 *                    The Woodlands, TX, USA  77381
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *    * Redistributions of source code must retain the above copyright
 *      notice(s), this list of conditions and the following disclaimer.
 *    * Redistributions in binary form must reproduce the above copyright
 *      notice(s), this list of conditions and the following disclaimer in the
 *      documentation and/or other materials provided with the distribution.
 *    * Neither the name of the Rigaku Americas Corporation nor the 
 *      names of its contributors may be used to endorse or promote products
 *      derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL RIGAKU AMERICAS CORPORATION BE LIABLE 
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA OR PROFITS; OR BUSINESS INTERUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
 * DAMAGE.
 *
*/

//
// README: Portions of this file are merged at file generation
// time. Edits can be made *only* in between specified code blocks, look
// for keywords <Begin user code> and <End user code>.
//
/////////////////////////////////////////////////////////////
//
// Source file for CUIom8
//
//    This file generated by Builder Xcessory 3.5.1.
//
//    This class is a user interface "component", as described
//    in "Object-Oriented Programming with C++ and OSF/Motif",
//    by Douglas Young, Prentice Hall, 1992. ISBN 0-13-630252-1
//
/////////////////////////////////////////////////////////////
#include <X11/StringDefs.h>
#include <Xm/Form.h>
#include <Xm/RowColumn.h>
#include <Xm/PushB.h>
#include "CUIom8.h"

//
// Convenience functions from utilities file.
//
extern void RegisterBxConverters(XtAppContext);
extern XtPointer BX_CONVERT(Widget, char *, char *, int, Boolean *);
extern XtPointer DOUBLE(double);
extern XtPointer SINGLE(float);
extern void MENU_POST(Widget, XtPointer, XEvent *, Boolean *);
extern Pixmap XPM_PIXMAP(Widget, char**);
extern void SET_BACKGROUND_COLOR(Widget, ArgList, Cardinal*, Pixel);


// Begin user code block <head> 
// End user code block <head> 

//
// This table is used to define class resources that are placed
// in app-defaults. This table is necessary so each instance
// of this class has the proper default resource values set.
// This eliminates the need for each instance to have
// its own app-defaults values. This table must be NULL terminated.
//
#if defined(cxx_bx_compat)

Boolean CUIom8::_initAppDefaults = True;
UIAppDefault  CUIom8::_appDefaults[] = {
    {"om9", NULL, "sensitive", NULL},
    {"om9", NULL, "labelString", NULL},
    {"pb0", NULL, "sensitive", NULL},
    {"pb0", NULL, "labelString", NULL},
    {"pb1", NULL, "sensitive", NULL},
    {"pb1", NULL, "labelString", NULL},
    {"pb2", NULL, "sensitive", NULL},
    {"pb2", NULL, "labelString", NULL},
    {"pb3", NULL, "sensitive", NULL},
    {"pb3", NULL, "labelString", NULL},
    {"pb4", NULL, "sensitive", NULL},
    {"pb4", NULL, "labelString", NULL},
    {"pb5", NULL, "sensitive", NULL},
    {"pb5", NULL, "labelString", NULL},
    {"pb6", NULL, "sensitive", NULL},
    {"pb6", NULL, "labelString", NULL},
    {"pb7", NULL, "sensitive", NULL},
    {"pb7", NULL, "labelString", NULL},
    {"pb8", NULL, "sensitive", NULL},
    {"pb8", NULL, "labelString", NULL},
    {NULL, NULL, NULL, NULL}
};
#endif

// These are default resources for widgets in objects of this class
// All resources will be prepended by *<name> at instantiation,
// where <name> is the name of the specific instance, as well as the
// name of the baseWidget. These are only defaults, and may be overriden
// in a resource file by providing a more specific resource name

String  CUIom8::_defaultCUIom8Resources[] = {
        NULL
};

//
// Old style constructor, for compatibility only.
//
CUIom8::CUIom8(const char *name, Widget parent) : 
    CUIom9(name)
{
    
    // Begin user code block <alt_constructor> 
    // End user code block <alt_constructor> 
    create(parent);
}

//
// Class constructor.
//
CUIom8::CUIom8(const char *name) : CUIom9(name)
{
    
    // Begin user code block <constructor> 
    // End user code block <constructor> 
}

//
// Minimal Destructor. Base class destroys widgets.
//
CUIom8::~CUIom8() 
{
    
    // Begin user code block <destructor> 
    // End user code block <destructor> 
}

//
// Call superclass create to create common subclass widgets.
//
void CUIom8::create(Widget parent) 
{
    //
    // Load any class-defaulted resources for this object.
    //
    setDefaultResources(parent, _defaultCUIom8Resources);
    
#if defined(cxx_bx_compat)
    //
    // Setup app-defaults fallback table if not already done.
    //
    if (_initAppDefaults)
    {
        initAppDefaults(parent, "CUIom8", _appDefaults);
        _initAppDefaults = False;
    }
    //
    // Now set the app-defaults for this instance.
    //
    setAppDefaults(parent, _appDefaults, _name, True);
#endif
    CUIom9::create(parent);
    
    //
    // Output parent class overridden resources here.
    //
    
    // Begin user code block <endcreate> 

    m_nNumOptions = 8;
    XtDestroyWidget(_pb8);
    _pb8 = NULL;

    // End user code block <endcreate> 
}

//
// Classname access.
//
const char *const CUIom8::className()
{
    return ("CUIom8");
}

// Begin user code block <tail> 
// End user code block <tail> 
